aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]/settings
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-03 14:00:14 -0700
committerAdam Soltys <[email protected]>2022-11-03 14:00:18 -0700
commitd608c466c30019c4cc7d038f2308ac0e5b204841 (patch)
tree1b9e230702431fd4cde777c4b242703b067dc12e /src/routes/(app)/[username]/settings
parentaa1f1cf0832c70c66b84cfe5e1bb2912a704fea3 (diff)
downloadcoinos-ui-d608c466c30019c4cc7d038f2308ac0e5b204841.tar.gz
coinos-ui-d608c466c30019c4cc7d038f2308ac0e5b204841.zip
invoice requests
Diffstat (limited to 'src/routes/(app)/[username]/settings')
-rw-r--r--src/routes/(app)/[username]/settings/+page.server.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/routes/(app)/[username]/settings/+page.server.js b/src/routes/(app)/[username]/settings/+page.server.js
index ae7e0a78..bf5661f6 100644
--- a/src/routes/(app)/[username]/settings/+page.server.js
+++ b/src/routes/(app)/[username]/settings/+page.server.js
@@ -1,12 +1,22 @@
import { invalid } from '@sveltejs/kit';
import { auth, get, post } from '$lib/utils';
+import Qr from 'qrcode-base64';
+
+export async function load({ locals: { user } }) {
+ return {
+ otpQr: Qr.drawImg(
+ `otpauth://totp/coinos:${user.username}?secret=${user.otpsecret}&period=30&digits=6&algorithm=SHA1&issuer=coinos`,
+ { size: 600 }
+ )
+ };
+}
export const actions = {
- default: async ({ cookies, request }) => {
+ default: async ({ cookies, locals, request }) => {
let form = Object.fromEntries(await request.formData());
let user = {
- ...(await get('/me', auth(cookies))),
+ ...locals.user,
...form
};